﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsMaterialTextureDataFiler : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsMaterialTextureDataFiler(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsMaterialTextureDataFiler obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsMaterialTextureDataFiler()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsMaterialTextureDataFiler(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public virtual bool saveClientMaterialTextureData(OdGiMaterialTextureData arg0, SWIGTYPE_p_OdGsFiler arg1)
		{
			bool result = GlobalsPINVOKE.OdGsMaterialTextureDataFiler_saveClientMaterialTextureData(this.swigCPtr, OdGiMaterialTextureData.getCPtr(arg0), SWIGTYPE_p_OdGsFiler.getCPtr(arg1));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual SWIGTYPE_p_OdSmartPtrT_OdGiMaterialTextureData_t loadClientMaterialTextureData(SWIGTYPE_p_OdGsFiler arg0)
		{
			SWIGTYPE_p_OdSmartPtrT_OdGiMaterialTextureData_t result = new SWIGTYPE_p_OdSmartPtrT_OdGiMaterialTextureData_t(GlobalsPINVOKE.OdGsMaterialTextureDataFiler_loadClientMaterialTextureData(this.swigCPtr, SWIGTYPE_p_OdGsFiler.getCPtr(arg0)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGsMaterialTextureDataFiler() : this(GlobalsPINVOKE.new_OdGsMaterialTextureDataFiler(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
